import {request} from '@/utils/request'
//base url
const BASE_URL = process.env.VUE_APP_API_BASE_URL
const api = {
    list_device_inspection_plan:'/device_inspection/list_device_inspection_plan_all',
    delete_device_inspection_plan:'/device_inspection/delete_device_inspection_plan',
    save_device_inspection_plan:'/device_inspection/save_device_inspection_plan',
    list_device_inspection_all:'/device_inspection/list_device_inspection_all',
    delete_device_inspection:'/device_inspection/delete_device_inspection',
    list_device_inspection_plan_by_user_id:'/device_inspection/list_device_inspection_plan_by_user_id',
    list_device_inspection_project_relation:'/device_inspection/list_device_inspection_project_relation',
    list_device_inspection_project:'/base_information/list_device_inspection_project',
    save_device_inspection_project:'/base_information/save_device_inspection_project',
    save_device_inspection:'/device_inspection/save_device_inspection',
    save_device_inspection_project_result:'/device_inspection/save_device_inspection_project_result',
}
for (const apiKey in api) {
    api[apiKey] = BASE_URL + api[apiKey];
}

export function save_device_inspection_project_result(parameter) {
    return request( api.save_device_inspection_project_result,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function save_device_inspection(parameter) {
    return request( api.save_device_inspection,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function save_device_inspection_project(parameter) {
    return request( api.save_device_inspection_project,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}


export function list_device_inspection_project(parameter) {
    return request( api.list_device_inspection_project,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}
export function list_device_inspection_project_relation(parameter) {
    return request( api.list_device_inspection_project_relation,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_device_inspection_plan_by_user_id(parameter) {
    return request( api.list_device_inspection_plan_by_user_id,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}


export function delete_device_inspection(parameter) {
    return request( api.delete_device_inspection,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function list_device_inspection_all(parameter) {
    return request( api.list_device_inspection_all,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_device_inspection_plan(parameter) {
    return request( api.save_device_inspection_plan,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}


export function list_device_inspection_plan(parameter) {
    return request( api.list_device_inspection_plan,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}
export function delete_device_inspection_plan(parameter) {
    return request( api.delete_device_inspection_plan,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}


